]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid: Take extra spacing into account for height requests
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 20 Feb 2013 02:18:48 +0000 (21:18 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 21 Feb 2013 00:38:38 +0000 (19:38 -0500)
This fixes the clipped app picker in the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=694234

js/ui/iconGrid.js

index 98e57613b5b0c37f1a1bb040df8685d8e6922aa9..b3755cbee94f88d77bf47fb0e084c466a9bd0a54 100644 (file)
@@ -218,11 +218,14 @@ const IconGrid = new Lang.Class({
 
     _getPreferredHeight: function (grid, forWidth, alloc) {
         let children = this._getVisibleChildren();
-        let nColumns;
-        if (forWidth < 0)
+        let nColumns, spacing;
+        if (forWidth < 0) {
             nColumns = children.length;
-        else
-            nColumns = this._computeLayout(forWidth)[0];
+            spacing = this._spacing;
+        } else {
+            [nColumns, , spacing] = this._computeLayout(forWidth);
+        }
+
         let nRows;
         if (nColumns > 0)
             nRows = Math.ceil(children.length / nColumns);
@@ -230,7 +233,7 @@ const IconGrid = new Lang.Class({
             nRows = 0;
         if (this._rowLimit)
             nRows = Math.min(nRows, this._rowLimit);
-        let totalSpacing = Math.max(0, nRows - 1) * this._spacing;
+        let totalSpacing = Math.max(0, nRows - 1) * spacing;
         let height = nRows * this._vItemSize + totalSpacing;
         alloc.min_size = height;
         alloc.natural_size = height;